#include "widget.h"
#include<QFileInfo>
#include <QDir>
#include <QApplication>
#include <QDebug>

quint64 dirFileSize(const QString &path)
{
    QDir dir(path);
    quint64 size = 0;
    foreach(QFileInfo fileInfo, dir.entryInfoList(QDir::Files))
    {
        size += fileInfo.size();
    }
    foreach(QString subDir, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
    {
        size += dirFileSize(path + QDir::separator() + subDir);
    }
    return size;
}

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    quint64 sie=dirFileSize("D:/ProgramData");
    quint64 mb=sie/1073741824;
    int b=3;
    if(mb>b){
        qDebug()<<sie<<mb;}
    Widget w;
    w.show();
    return a.exec();
}
